/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package aplikasi.com.implement;

import aplikasi.com.entity.catatSewa;
import aplikasi.com.interfac.interCatatSewa;
import aplikasi.com.koneksiDatabase.DatabaseUtilities;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 *
 * @author Henfryandie
 */
public class implemCatatSewa implements interCatatSewa{
    public catatSewa insertSewa(catatSewa o) throws SQLException{
        String sqlInsert = "";
        PreparedStatement ps = DatabaseUtilities.getConnection().prepareStatement(sqlInsert);
        ps.setInt(1, o.getIdSewa());
        ps.setDate(2, (Date) o.getTanggalSewa());
        ps.setDate(3, (Date) o.getTanggalKembali());
        ps.setInt(4, o.getDataid().getIdKomik());
        ps.setInt(5, o.getDataidP().getIdPelanggan());
        ps.executeUpdate();
        return o;



    }
}
